﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using FazaDemo.BL.AppFacade;
using FazaDemo.BL.SubDomains;

namespace FazaDemo.WebSiteMvc.Controllers
{
    public class StartController : Controller
    {

        private readonly IRootInfoReceiver receiver;

        public StartController()
        {
            receiver = new RootInfoReceiver();
        }

        // GET: Root
        [HttpGet]
        public ActionResult Root()
        {
            return View();
        }

        public ActionResult RootInfo()
        {
            IEnumerable<RootInfo> rootItems = receiver.GetRootInfo();
            return Json(rootItems, JsonRequestBehavior.AllowGet);
        }

    }
}
